/**
 * 
 */
package com.wolfpire.system.model;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.GrantedAuthorityImpl;
import org.springframework.security.core.userdetails.UserDetails;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.wolfpire.system.common.Constants;

/**
 * 学习记录实体
 * @author lihd
 *
 */

@Entity
@Table(name = "t_study_history")
public class StudyHistory implements Serializable {
	
	private static final long serialVersionUID = 1339937204555946220L;
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "id", unique = true, nullable = false, length = 16)
	private Long id;               //主键Id
	
	@Column(name = "user_id", length = 32)
	private Long userId;           //学习用户
	
	@Column(name = "subject_id", length = 32)
	private Long subjectId;           //学科ID
	
	@Column(name = "section_id", length = 32)
	private Long sectionId;          //节ID
	
	@Column(name = "subjec_name", length = 75)
	private String subjectName; //学科名称
	
	@Column(name = "chapter_name", length = 75)
	private String chapterName; //章名称
	
	@Column(name = "section_name", length = 75)
	private String sectionName; //节名称
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "record_time")
	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")  
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") 
	private Date recordTime = new Date();       //创建时间
	
	@Column(name = "flag", length = 75)
	private String flag;                            //标识位   开始时间   结束时间  评论时间
	
	@Column(name = "content", length = 75)
	private String content;             //内容
	
	@Column(name = "xingxing", length = 75)
	private String xingxing;             //内容
	
	
	/*@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_time")
	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")  
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") 
	private Date createTime = new Date();       //创建时间
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "end_time")
	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")  
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") 
	private Date endTime = new Date();         //结束时间
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "pinlun_time")
	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")  
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") 
	private Date pinLunTime = new Date();       //评论时间
*/
	
	public StudyHistory() {
		super();
		// TODO Auto-generated constructor stub
	}

	
	public StudyHistory(Long userId, Long subjectId, Long sectionId, String subjectName, String chapterName,
			String sectionName,String content, Date recordTime, String flag, String xingxing) {
		super();
		this.userId = userId;
		this.subjectId = subjectId;
		this.sectionId = sectionId;
		this.subjectName = subjectName;
		this.chapterName = chapterName;
		this.sectionName = sectionName;
		this.content = content;
		this.recordTime = recordTime;
		this.flag = flag;
		this.xingxing = xingxing;
	}


	/*public StudyHistory(Long userId, String subjectName, String chapterName,
			String sectionName, Date createTime, Date endTime, Date pinLunTime) {
		super();
		this.userId = userId;
		this.subjectName = subjectName;
		this.chapterName = chapterName;
		this.sectionName = sectionName;
		this.createTime = createTime;
		this.endTime = endTime;
		this.pinLunTime = pinLunTime;
	}*/


	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public String getSubjectName() {
		return subjectName;
	}

	public void setSubjectName(String subjectName) {
		this.subjectName = subjectName;
	}

	public String getChapterName() {
		return chapterName;
	}

	public void setChapterName(String chapterName) {
		this.chapterName = chapterName;
	}

	public String getSectionName() {
		return sectionName;
	}

	public void setSectionName(String sectionName) {
		this.sectionName = sectionName;
	}


	public Date getRecordTime() {
		return recordTime;
	}


	public void setRecordTime(Date recordTime) {
		this.recordTime = recordTime;
	}


	public String getFlag() {
		return flag;
	}


	public void setFlag(String flag) {
		this.flag = flag;
	}


	public String getContent() {
		return content;
	}


	public void setContent(String content) {
		this.content = content;
	}


	public Long getSubjectId() {
		return subjectId;
	}


	public void setSubjectId(Long subjectId) {
		this.subjectId = subjectId;
	}


	public Long getSectionId() {
		return sectionId;
	}


	public void setSectionId(Long sectionId) {
		this.sectionId = sectionId;
	}


	public String getXingxing() {
		return xingxing;
	}


	public void setXingxing(String xingxing) {
		this.xingxing = xingxing;
	}
	
	
	
	
}
